package terminal_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 终端-终端指令类型
type terminalInstructionType int

var TerminalInstructionType terminalInstructionType

// 锁车
func (c *terminalInstructionType) LockCar() int {
	return 1
}

// 限速
func (c *terminalInstructionType) LimitSpeed() int {
	return 2
}

// 限举
func (c *terminalInstructionType) LimitLift() int {
	return 3
}

// 设置车辆控制
func (c *terminalInstructionType) SetCarCtrl() int {
	return 4
}

// 摄像头拍照
func (c *terminalInstructionType) ShootMedia() int {
	return 5
}

// 获取媒体数据
func (c *terminalInstructionType) GetMedia() int {
	return 6
}

// 录音
func (c *terminalInstructionType) RecordSound() int {
	return 7
}

// 检索媒体
func (c *terminalInstructionType) SearchMedia() int {
	return 8
}

// 上传媒体数据
func (c *terminalInstructionType) UploadMedia() int {
	return 9
}

// 数据透传
func (c *terminalInstructionType) DataPasThrough() int {
	return 10
}

// 回拨电话
func (c *terminalInstructionType) CallPhone() int {
	return 11
}

// 车辆点名
func (c *terminalInstructionType) GetPos() int {
	return 12
}

// 下发提问
func (c *terminalInstructionType) IssuedQuestion() int {
	return 13
}

// 获取终端属性
func (c *terminalInstructionType) GetTerminalAttr() int {
	return 14
}

// 无线升级终端
func (c *terminalInstructionType) UpdateTerminalWireless() int {
	return 15
}

// 关闭终端
func (c *terminalInstructionType) ShutdownTerminal() int {
	return 16
}

// 复位终端
func (c *terminalInstructionType) ResetTerminal() int {
	return 17
}

// 恢复终端出厂设置
func (c *terminalInstructionType) RestoreTerminal() int {
	return 18
}

// 设置终端参数
func (c *terminalInstructionType) SetTerminalParam() int {
	return 19
}

// 获取终端参数
func (c *terminalInstructionType) GetTerminalParam() int {
	return 20
}

// 文本下发
func (c *terminalInstructionType) DeliveryText() int {
	return 21
}

// 车辆追踪
func (c *terminalInstructionType) TrackPos() int {
	return 22
}

func (c *terminalInstructionType) ToText(value int) string {
	switch value {

	case 1:
		return "锁车"

	case 2:
		return "限速"

	case 3:
		return "限举"

	case 4:
		return "设置车辆控制"

	case 5:
		return "摄像头拍照"

	case 6:
		return "获取媒体数据"

	case 7:
		return "录音"

	case 8:
		return "检索媒体"

	case 9:
		return "上传媒体数据"

	case 10:
		return "数据透传"

	case 11:
		return "回拨电话"

	case 12:
		return "车辆点名"

	case 13:
		return "下发提问"

	case 14:
		return "获取终端属性"

	case 15:
		return "无线升级终端"

	case 16:
		return "关闭终端"

	case 17:
		return "复位终端"

	case 18:
		return "恢复终端出厂设置"

	case 19:
		return "设置终端参数"

	case 20:
		return "获取终端参数"

	case 21:
		return "文本下发"

	case 22:
		return "车辆追踪"

	}
	return ""
}

func (c *terminalInstructionType) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *terminalInstructionType) ToValue(text string) int {
	switch text {

	case "锁车":
		return 1

	case "限速":
		return 2

	case "限举":
		return 3

	case "设置车辆控制":
		return 4

	case "摄像头拍照":
		return 5

	case "获取媒体数据":
		return 6

	case "录音":
		return 7

	case "检索媒体":
		return 8

	case "上传媒体数据":
		return 9

	case "数据透传":
		return 10

	case "回拨电话":
		return 11

	case "车辆点名":
		return 12

	case "下发提问":
		return 13

	case "获取终端属性":
		return 14

	case "无线升级终端":
		return 15

	case "关闭终端":
		return 16

	case "复位终端":
		return 17

	case "恢复终端出厂设置":
		return 18

	case "设置终端参数":
		return 19

	case "获取终端参数":
		return 20

	case "文本下发":
		return 21

	case "车辆追踪":
		return 22

	}
	return 0
}
